Candidate Api


Methods Download wsdl

Import candidates, see the status of current candidates/applications. When candidates get approved, they get a higher status and are considered to be products.

Candidate and product are described by the same object - ApiProduct


Add new or update existing candidates.

The property Id in ApiProduct of the provided candidates must be set in the request. The candidates are identified by this property. For new candidates set Id to 0.

NOTE! New candidates automatically get status Revision!

The size of one application (count of candidates in one request), is likely to be limited to more than 100, but less than 1000. Administrators cannot handle huge amounts of candidates at the same time.

Parameters

Returns

Example Request xml
<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' 
  xmlns:apirequest='Prodibas.API.V1' 
  xmlns:product='Prodibas.API.V1.Model' 
  xmlns:arr='http://schemas.microsoft.com/2003/10/Serialization/Arrays' 
  xmlns:outputoptions='Prodibas.API.V1.Parameters.OutputOptions' 
  xmlns:requestparams='Prodibas.API.V1.Parameters'>
   <soapenv:Header/>
   <soapenv:Body>
      <apirequest:Import>
         <!--Optional:-->
         <apirequest:candidates>
            <product:ApiProduct xmlns:i='http://www.w3.org/2001/XMLSchema-instance'>
               ...product properties...
            </product:ApiProduct>
            ... more products...
         </apirequest:candidates>
         <apirequest:ownerId>100</apirequest:ownerId>
         <apirequest:requestOptions>
            <requestparams:Authentication>
               <requestparams:CompanyIdentifier>MANU616</requestparams:CompanyIdentifier>
               <requestparams:Industry>VVS</requestparams:Industry>
               <requestparams:Key>DEVMANU616</requestparams:Key>
            </requestparams:Authentication>
         </apirequest:requestOptions>
      </apirequest:Import>
   </soapenv:Body>
</soapenv:Envelope>

Example Response xml
<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'>
   <s:Body>
      <ImportResponse xmlns='Prodibas.API.V1'>
         <ImportResult 
           xmlns:a='Prodibas.API.V1.Parameters' 
           xmlns:i='http://www.w3.org/2001/XMLSchema-instance'>
            <a:Data xmlns:b='Prodibas.API.V1.Model'/>
            <a:User 
              xmlns:b='http://schemas.datacontract.org/2004/07/WebService.V1.Parameters'>
               <b:Email i:nil='true'/>
               <b:Id>6479</b:Id>
               <b:Name>API</b:Name>
            </a:User>
         </ImportResult>
      </ImportResponse>
   </s:Body>
</s:Envelope>

Same functionality as Import method, but returns a list of ApiCandidateImportGroupedResult.

Parameters

Returns

Example Request xml
<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' 
  xmlns:apirequest='Prodibas.API.V1' 
  xmlns:product='Prodibas.API.V1.Model' 
  xmlns:arr='http://schemas.microsoft.com/2003/10/Serialization/Arrays' 
  xmlns:outputoptions='Prodibas.API.V1.Parameters.OutputOptions' 
  xmlns:requestparams='Prodibas.API.V1.Parameters'>
   <soapenv:Header/>
   <soapenv:Body>
      <apirequest:ImportWithGroupedResult>
         <!--Optional:-->
         <apirequest:candidates>
            <product:ApiProduct xmlns:i='http://www.w3.org/2001/XMLSchema-instance'>
               ...product properties...
            </product:ApiProduct>
            ... more products...
         </apirequest:candidates>
         <apirequest:ownerId>100</apirequest:ownerId>
         <apirequest:requestOptions>
            <requestparams:Authentication>
               <requestparams:CompanyIdentifier>MANU616</requestparams:CompanyIdentifier>
               <requestparams:Industry>VVS</requestparams:Industry>
               <requestparams:Key>DEVMANU616</requestparams:Key>
            </requestparams:Authentication>
         </apirequest:requestOptions>
      </apirequest:ImportWithGroupedResult>
   </soapenv:Body>
</soapenv:Envelope>

Example Response xml
<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'>
   <s:Body>
      <ImportWithGroupedResultResponse xmlns='Prodibas.API.V1'>
         <ImportWithGroupedResultResult 
           xmlns:a='Prodibas.API.V1.Parameters' 
           xmlns:i='http://www.w3.org/2001/XMLSchema-instance'>
            <a:Data xmlns:b='Prodibas.API.V1.Model'>
               <b:ApiCandidateImportResults>
                  <b:ApiCandidateImportResult>
                     <b:ApiModelValidationErrors/>
                     <b:Index>0</b:Index>
                     <b:ProductId>1435535</b:ProductId>
                     <b:ProductIdentifier>ART1435535</b:ProductIdentifier>
                  </b:ApiCandidateImportResult>
                  <b:ApiCandidateImportResult>
                     <b:ApiModelValidationErrors>
                        <b:ApiModelValidationError>
                           <b:Field>NameSv</b:Field>
                           <b:Message>...</b:Message>
                        </b:ApiModelValidationError>
                     </b:ApiModelValidationErrors>
                     <b:Index>1</b:Index>
                     <b:ProductId>1435536</b:ProductId>
                     <b:ProductIdentifier>ART1435536</b:ProductIdentifier>
                  </b:ApiCandidateImportResult>
               </b:ApiCandidateImportResults>
               <b:CandidatesImported>false</b:CandidatesImported>
            </a:Data>
            <a:User 
              xmlns:b='http://schemas.datacontract.org/2004/07/WebService.V1.Parameters'>
               <b:Email i:nil='true'/>
               <b:Id>6479</b:Id>
               <b:Name>API</b:Name>
            </a:User>
         </ImportWithGroupedResultResult>
      </ImportWithGroupedResultResponse>
   </s:Body>
</s:Envelope>

Get all candidate groups for a manufacturer, including the candidates.

View candidate change history

Include a list of changes to the candidates in the groups by setting StructuredOutputOptions.ActivityLog to true.

Parameters

Returns

Example Request xml
<soapenv:Envelope 
  xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' 
  xmlns:apirequest='Prodibas.API.V1' 
  xmlns:outputoptions='Prodibas.API.V1.Parameters.OutputOptions' 
  xmlns:requestparams='Prodibas.API.V1.Parameters'>
   <soapenv:Header/>
   <soapenv:Body>
      <apirequest:GetCandidateGroups>
         <apirequest:manufacturerIdentifier>MANU616</apirequest:manufacturerIdentifier>
         <apirequest:structuredOutputOptions>
            <outputoptions:Accessories>false</outputoptions:Accessories>
            <outputoptions:ActivityLog>true</outputoptions:ActivityLog>
            <outputoptions:Etim>0</outputoptions:Etim>
            <outputoptions:ExtNumbers>false</outputoptions:ExtNumbers>
            <outputoptions:Packages>false</outputoptions:Packages>
            <outputoptions:ProductGroups>false</outputoptions:ProductGroups>
            <outputoptions:Serie>false</outputoptions:Serie>
            <outputoptions:Uris>false</outputoptions:Uris>
         </apirequest:structuredOutputOptions>
         <apirequest:request>
            <requestparams:Authentication>
               <requestparams:CompanyIdentifier>MANU616</requestparams:CompanyIdentifier>
               <requestparams:Industry>VVS</requestparams:Industry>
               <requestparams:Key>DEVMANU616</requestparams:Key>
            </requestparams:Authentication>
         </apirequest:request>
      </apirequest:GetCandidateGroups>
   </soapenv:Body>
</soapenv:Envelope>

Example Response xml
<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'>
   <s:Body>
      <GetCandidateGroupsResponse xmlns='Prodibas.API.V1'>
         <GetCandidateGroupsResult
           xmlns:a='Prodibas.API.V1.Parameters' 
           xmlns:i='http://www.w3.org/2001/XMLSchema-instance'>
            <a:Data xmlns:b='Prodibas.API.V1.Model'>
               <b:ApiCandidateGroup>
                  <b:EarliestBecameRevisionDate i:nil='true'/>
                  <b:EarliestBecameRevisionDateIsSpecified>false</b:EarliestBecameRevisionDateIsSpecified>
                  <b:Id>12279</b:Id>
                  <b:IdIsSpecified>false</b:IdIsSpecified>
                  <b:IsDefault>true</b:IsDefault>
                  <b:IsDefaultIsSpecified>false</b:IsDefaultIsSpecified>
                  <b:Messages/>
                  <b:MessagesIsSpecified>false</b:MessagesIsSpecified>
                  <b:Name>Nya ansökningar för Gästföretaget, Gäst</b:Name>
                  <b:NameIsSpecified>false</b:NameIsSpecified>
                  <b:OwnerId>9952</b:OwnerId>
                  <b:ProductGroups>
                     <b:ApiCandidateGroup.ApiCandidateProductGroup>
                        <b:FullIdentifier>010200</b:FullIdentifier>
                        <b:FullIdentifierIsSpecified>false</b:FullIdentifierIsSpecified>
                        <b:FullName>Gjutjärnsrör > Tryckrörssystem > Rör</b:FullName>
                        <b:FullNameIsSpecified>false</b:FullNameIsSpecified>
                        <b:Id>3</b:Id>
                        <b:IdIsSpecified>false</b:IdIsSpecified>
                        <b:Identifier>00</b:Identifier>
                        <b:IdentifierIsSpecified>false</b:IdentifierIsSpecified>
                        <b:Name>Rör</b:Name>
                        <b:NameIsSpecified>false</b:NameIsSpecified>
                        <b:Range>
                           <b:Max>1025170</b:Max>
                           <b:MaxIsSpecified>false</b:MaxIsSpecified>
                           <b:Min>1024660</b:Min>
                           <b:MinIsSpecified>false</b:MinIsSpecified>
                        </b:Range>
                        <b:RangeIsSpecified>false</b:RangeIsSpecified>
                        <b:Items>
                           <b:ApiCandidateGroup.ApiCandidateItem>
                              <b:BecameRevisionDate i:nil='true'/>
                              <b:Product>
                                 <b:ActivityLogs>
                                    <b:ApiActivityLog>
                                       ... activity log properties...
                                    </b:ApiActivityLog>
                                    ...
                                 </b:ActivityLogs>
                                 ... product properties...
                              </b:Product>
                              <b:ProductIsSpecified>false</b:ProductIsSpecified>
                              <b:RowNumber>1</b:RowNumber>
                              <b:RowNumberIsSpecified>false</b:RowNumberIsSpecified>
                              <b:Status>NotReviewed</b:Status>
                              <b:StatusIsSpecified>false</b:StatusIsSpecified>
                           </b:ApiCandidateGroup.ApiCandidateItem>
                           ...
                        </b:Items>
                        <b:ItemsIsSpecified>false</b:ItemsIsSpecified>
                     </b:ApiCandidateGroup.ApiCandidateProductGroup>
                  </b:ProductGroups>
                  <b:ProductGroupsIsSpecified>false</b:ProductGroupsIsSpecified>
               </b:ApiCandidateGroup>
               ...
            </a:Data>
            <a:User xmlns:b='http://schemas.datacontract.org/2004/07/WebService.V1.Parameters'>
               <b:Email i:nil='true'/>
               <b:Id>6479</b:Id>
               <b:Name>API</b:Name>
            </a:User>
         </GetCandidateGroupsResult>
      </GetCandidateGroupsResponse>
   </s:Body>
</s:Envelope>

Same functionality as GetCandidateGroups method but allows filtering of the result on for example productId or on candidates where quittance has been sent after a specified date.

View candidate change history

Include a list of changes to the candidates in the groups by setting StructuredOutputOptions.ActivityLog to true.

Parameters

Returns

Change the status of a list of candidates.

NOTE 1 You can only change status on items from NotReviewed to Revision!

NOTE 2 The list of productIds supplied must be in the same candidate group!

Parameters

Returns

Example Request xml
<soapenv:Envelope 
  xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' 
  xmlns:apirequest='Prodibas.API.V1' 
  xmlns:arr='http://schemas.microsoft.com/2003/10/Serialization/Arrays' 
  xmlns:requestparams='Prodibas.API.V1.Parameters'>
   <soapenv:Header/>
   <soapenv:Body>
      <apirequest:ChangeStatus>
         <apirequest:productIds>
            <arr:long>1435512</arr:long>
            ...
         </apirequest:productIds>
         <apirequest:status>Revision</apirequest:status>
         <apirequest:message>Sending to revision...</apirequest:message>
         <apirequest:requestOptions>
            <requestparams:Authentication>
               <requestparams:CompanyIdentifier>MANU616</requestparams:CompanyIdentifier>
               <requestparams:Industry>VVS</requestparams:Industry>
               <requestparams:Key>DEVMANU616</requestparams:Key>
            </requestparams:Authentication>
         </apirequest:requestOptions>
      </apirequest:ChangeStatus>
   </soapenv:Body>
</soapenv:Envelope>

Example Response xml
<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'>
   <s:Body>
      <ChangeStatusResponse xmlns='Prodibas.API.V1'>
         <ChangeStatusResult 
           xmlns:a='Prodibas.API.V1.Parameters' 
           xmlns:i='http://www.w3.org/2001/XMLSchema-instance'>
            <a:Data xmlns:b='Prodibas.API.V1.Model'/>
            <a:User i:nil='true' 
              xmlns:b='http://schemas.datacontract.org/2004/07/WebService.V1.Parameters'/>
         </ChangeStatusResult>
      </ChangeStatusResponse>
   </s:Body>
</s:Envelope>


Common objects

There are some objects that are used in requests/responses across the API services and methods. For example:

  • All requests contains an authentication object
  • The update methods can have validation errors
  • Some requests are queued and a Pingback url can be provided in the request and used instead of polling the corresponding GetResult method

Authentication

The ApiAuthentication object contains three parts:

  • The company identifier, on the format "MANU" + the company number
  • Industry e.g "VVS" or "SEG"
  • The authentication key

public class ApiAuthentication
{
    public string CompanyIdentifier { get; set; }   // string.Format("MANU{0}", company.Id)
    public Industry Industry { get; set; }          // see enum below
    public string Key { get; set; }                 // any of your active API keys. 
}
public enum Industry
{
    VVS = 1, 
    SEG = 2
}
Example xml

In example, the key is for the dev environment. Not applicable elsewhere.


<requestparams:Authentication>
       <requestparams:CompanyIdentifier>MANU999</requestparams:CompanyIdentifier>
       <requestparams:Industry>VVS</requestparams:Industry>
       <requestparams:Key>DEVMANU999</requestparams:Key>
</requestparams:Authentication>


Request objects

Every request has to provide authentication information as an input parameter.

Anonymous requests are blocked.

public class ApiRequest
{
    public ApiAuthentication Authentication { get; set; }
}
Example xml

<soapenv:Envelope 
	xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' 
    xmlns:apirequest='Prodibas.API.V1' 
    xmlns:outputopts='Prodibas.API.V1.Parameters.OutputOptions' 
    xmlns:requestparams='Prodibas.API.V1.Parameters'>
<soapenv:Header/>

...
 <apirequest:GetByIdentifier> (example method)
...
 <apirequest:productIdentifier> (example params for this method)
...
 <apirequest:structuredOutputOptions> (example optional params for this method)
...
 <apirequest:requestOptions>  (required authentication for all requests )
    <requestparams:Authentication>
       <requestparams:CompanyIdentifier>MANU999</requestparams:CompanyIdentifier>
       <requestparams:Industry>VVS</requestparams:Industry>
       <requestparams:Key>DEVMANU999</requestparams:Key>
    </requestparams:Authentication>
 </apirequest:requestOptions>

The ApiQueuedRequest is a request that will be queued and processed in batch.

It will return a QueuedId of the queued request which then can be used to poll result.

public class ApiQueuedRequest : ApiRequest
{
    public string  PingBackUrl { get; set; }
}

If PingBackUrl is present, the service will make one HTTP GET request to notify the client-side that the queued work has been processed. Firewall port openings might be required on the client-side. Unreliable if there are network issues.

Example xml

<soapenv:Envelope 
	xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'
	xmlns:apirequest='Prodibas.API.V1' 
	xmlns:requestparams='Prodibas.API.V1.Parameters'
	xmlns:outputopts='Prodibas.API.V1.Parameters.OutputOptions'>
	<soapenv:Header/>
	<soapenv:Body>
...
 <apirequest:GetManyByIdentifiersQueued> (example method)
...
 <apirequest:productIdentifier> (example params for this method)
...
 <apirequest:structuredOutputOptions> (example optional params for this method)
...
<apirequest:queuedRequestOptions> (required authentication for all requests )
	<requestparams:Authentication>
		<requestparams:CompanyIdentifier>MANU999</requestparams:CompanyIdentifier>
		<requestparams:Industry>VVS</requestparams:Industry>
		<requestparams:Key>DEVMANU999</requestparams:Key>
	</requestparams:Authentication>
	<requestparams:PingBackUrl></requestparams:PingBackUrl> (optional PingBackUrl)
</apirequest:queuedRequestOptions>

The ApiUpdateRequest object is one of the parameters for UpdateSingle

If an update request attempts to update documents (the term documents refers to both images and documents that are linked to a product) the documents are provided in a list of ApiUploadDocument (see below).

The product uri and document is linked together by using the same string value for ApiUploadDocument.FileName and ApiProductUri.Url. Several products and/or product uris can link to the same document. In this case it is only necessary to provide one document in the request.

FileName must be unique within your company's "sandbox". Prodibas will rename the files according to the internal rules.

Enabling changes to documents

Note: The fields Type, TypeIsSpecified, Uri, UriIsSpecified and UrisIsSpecified must be set for any changes of a document to have effect. If the document referred to in field Uri is not an external link, a ApiUploadDocument must also be provided.

public class ApiUpdateRequest : ApiRequest 
{
    public List<ApiUploadDocument> Documents { get; set; }
}

public class ApiUploadDocument
{
    public string FileName { get; set; }
    public byte[] Bytes { get; set; }
}

See also:

Example xml

<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'>
	<s:Header></s:Header>
	<s:Body>
		<UpdateSingle xmlns='Prodibas.API.V1'>
			<product xmlns:a='Prodibas.API.V1.Model' 
			xmlns:i='http://www.w3.org/2001/XMLSchema-instance'>
				... product properties...
				<a:Uris>
					... uris...
					<a:ApiProductUri>
						... uri properties...
						<a:Type>BILD</a:Type>
						<a:TypeIsSpecified>true</a:TypeIsSpecified>
						... uri properties...
						<a:Uri>filename1.jpg</a:Uri>
						<a:UriIsSpecified>true</a:UriIsSpecified>
					</a:ApiProductUri>
					... uris...
					<a:ApiProductUri>
						... uri properties...
						<a:Type>MAN</a:Type>
						<a:TypeIsSpecified>true</a:TypeIsSpecified>
						... uri properties...
						<a:Uri>filename2.pdf</a:Uri>
						<a:UriIsSpecified>true</a:UriIsSpecified>
					</a:ApiProductUri>
					... uris...
					<a:ApiProductUri>
						... uri properties...
						<a:Type>PROD</a:Type>
						<a:TypeIsSpecified>true</a:TypeIsSpecified>
						... uri properties...
						<a:Uri>filename2.pdf</a:Uri>
						<a:UriIsSpecified>true</a:UriIsSpecified>
					</a:ApiProductUri>
					... uris...
				</a:Uris>
				<a:UrisIsSpecified>true</a:UrisIsSpecified>
				... product properties...
			</product>
			<structuredInputOptions xmlns:a='Prodibas.API.V1.Parameters.OutputOptions' i:nil='true' xmlns:i='http://www.w3.org/2001/XMLSchema-instance'></structuredInputOptions>
			<requestOptions xmlns:a='Prodibas.API.V1.Parameters' xmlns:i='http://www.w3.org/2001/XMLSchema-instance'>
				<a:Authentication>
					<a:CompanyIdentifier>MANU999</a:CompanyIdentifier>
					<a:Industry>VVS</a:Industry>
					<a:Key>DEVMANU999</a:Key>
				</a:Authentication>
				<a:Documents>
					<a:ApiUploadDocument>
						<a:Bytes>... a base64 encoded document</a:Bytes>
						<a:FileName>filename1.jpg</a:FileName>
					</a:ApiUploadDocument>
					<a:ApiUploadDocument>
						<a:Bytes>... another base64 encoded document</a:Bytes>
						<a:FileName>filename2.pdf</a:FileName>
					</a:ApiUploadDocument>
				</a:Documents>
			</requestOptions>
		</UpdateSingle>
	</s:Body>
</s:Envelope>



If no documents are provided, the documents section is set to null

 
...
        <a:Documents i:nil='true'>
        </a:Documents>
...

The ApiQueuedUpdateRequest object is one of the parameters for UpdateManyQueued. It's identical to ApiUpdateRequest but also includes the PingBackUrl.

public class ApiQueuedUpdateRequest : ApiUpdateRequest 
{
    public string PingBackUrl { get; set; }
}

If PingBackUrl is present, the service will make one HTTP GET request to notify the client-side that the queued work has been processed. Firewall port openings might be required on the client-side. Unreliable if there are network issues.


Response objects

Most API responses contains a Data and a User object. What type Data is depends on the request method. The User object contains information about the user who made the request.

[DataContract(Name = "ApiResponse_{0}")]
public class ApiResponse<T>
{
    public T Data { get; set; }
    public ApiUser User { get; set; }
}

public class ApiUser
{
    public int Id { get; set; }
    public string Email { get; set; }
    public string Name { get; set; }
}

For example, a response could have the following signature:

Example xml

<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'>
	<s:Body>
		<GetSingleByIdentifierResponse xmlns='Prodibas.API.V1'> (example method)
			<GetSingleByIdentifierResult 
			xmlns:a='Prodibas.API.V1.Parameters'
			xmlns:i='http://www.w3.org/2001/XMLSchema-instance'>
				<a:Data xmlns:b='Prodibas.API.V1.Model'>
				... product properties...
				</a:Data>
				<a:User 
				xmlns:b='http://schemas.datacontract.org/2004/07/WebService.V1.Parameters'>
					<b:Email i:nil='true'/>
					<b:Id>1</b:Id>
					<b:Name>Test Testsson</b:Name>
				</a:User>
			</GetSingleByIdentifierResult>
		</GetSingleByIdentifierResponse>
	</s:Body>
</s:Envelope>

A queued/batched request returns a ApiQueuedResponse containing a QueueId. The QueueId is used to receive the result by using the GetResult or GetUpdateResult methods.

public class ApiQueuedResponse
{
    public int QueueId { get; set; }
}
Example xml

<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'>
	<s:Body>
		<GetManyByIdentifiersQueuedResponse xmlns='Prodibas.API.V1'> (example method)
			<GetManyByIdentifiersQueuedResult 
			xmlns:a='Prodibas.API.V1.Parameters' 
			xmlns:i='http://www.w3.org/2001/XMLSchema-instance'>
				<a:QueueId>67640</a:QueueId>
			</GetManyByIdentifiersQueuedResult>
		</GetManyByIdentifiersQueuedResponse>
	</s:Body>
</s:Envelope>


Pingback url

A PingBackUrl can optionally be provided in all queued requests.

If PingBackUrl is present, the service will make one HTTP GET request to notify the client-side that the queued work has been processed. Firewall port openings might be required on the client-side. Unreliable if there are network issues.

Add QueueId to the pingback url

You can insert {QueueId} into the pingback url and it will be replaced with the QueueId of the request.

If this is sent to the service:
http://myserver.mydomain.com?MyownId=ABC123&QueueId={QueueId}

It could result in a pingback call like this:
http://myserver.mydomain.com?MyownId=ABC123&QueueId=12345


Validation errors

Validation errors can be returned in the response as a result of a failed product(s) update operation.

Prodibas uses comprehensive validation of incoming data. Some of the rules relates to other products in the system. There are also rules regarding roles and the right to change some data. If the API refuses to write data because of validation rules, it responds with one or several ApiModelValidationErrors.

Client side should always verify the result of writing data to Prodibas. Client side should also provide a way to present a report to the end-user.

public class ApiModelValidationError 
{
    public string Field { get; set; }
    public string Message { get; set; } 
}
Example xml

<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'>
	<s:Body>
		<UpdateSingleResponse xmlns='Prodibas.API.V1'> (example method)
			<UpdateSingleResult xmlns:a='Prodibas.API.V1.Model' 
				xmlns:i='http://www.w3.org/2001/XMLSchema-instance'>
				<a:ApiModelValidationError>
					<a:Field>NameEn</a:Field>
					<a:Message>
						Artikel (4842188-123) valideringsfel. 
						Fält: Benämning Engelsk. Ogiltigt antal tecken. 
						Måste vara 30 eller färre. 
						Angivet värde=AS123 NameEn UpdateSingle 17:44
					</a:Message>
				</a:ApiModelValidationError>
				<a:ApiModelValidationError>
					<a:Field>Color</a:Field>
					<a:Message>
						Produkt (4842188-123) valideringsfel vid förändring. 
						Fält: Färg. Värdet kan endast ändras av en administratör.
					</a:Message>
				</a:ApiModelValidationError>
			</UpdateSingleResult>
		</UpdateSingleResponse>
	</s:Body>
</s:Envelope>


Candidate models

The model objects used to import, get and change status of candidates are described here.

NOTE! Candidate and product are described by the same object - ApiProduct


ApiCandidateGroup describes a candidate group, that is an application of candidates where the candidate themselves are grouped by product group.

ApiCandidateGroup

public class ApiCandidateGroup
{
    public DateTime? EarliestBecameRevisionDate { get; set; }
    public bool EarliestBecameRevisionDateIsSpecified { get; set; }
    public int Id { get; set; }
    public bool IdIsSpecified { get; set; }
    public bool IsDefault { get; set; }
    public bool IsDefaultIsSpecified { get; set; }
    public List<ApiCandidateMessage> Messages { get; set; }
    public bool MessagesIsSpecified { get; set; }
    public string Name { get; set; }
    public bool NameIsSpecified { get; set; }
    public int OwnerId { get; set; }
    public List<ApiCandidateProductGroup> ProductGroups { get; set; }
    public bool ProductGroupsIsSpecified { get; set; }
}
        

ApiCandidateProductGroup

ApiCandidateProductGroup inherits ApiProductGroup but also includes a list of candidates belonging to this product group.

public class ApiCandidateProductGroup : ApiProductGroup
{
    public List<ApiCandidateItem> Items { get; set; }
    public bool ItemsIsSpecified { get; set; }
}
        

ApiCandidateItem

public class ApiCandidateItem
{
    public int RowNumber { get; set; }
    public bool RowNumberIsSpecified { get; set; }
    public ApiCandidateItemStatus Status { get; set; }
    public bool StatusIsSpecified { get; set; }
    public ApiProduct Product { get; set; }
    public bool ProductIsSpecified { get; set; }
    public DateTime? BecameRevisionDate { get; set; }
}
       

ApiCandidateMessage

A message regarding for example why an application was sent back from revision.

public class ApiCandidateMessage
{
    public int Id { get; set; }
    public bool IdIsSpecified { get; set; }
    public string Text { get; set; }
    public bool TextIsSpecified { get; set; }
    public int CreatedById { get; set; }
    public bool CreatedByIdIsSpecified { get; set; }
    public string CreatedByName { get; set; }
    public bool CreatedByNameIsSpecified { get; set; }
    public string CreatedByCompany { get; set; }
    public bool CreatedByCompanyIsSpecified { get; set; }
    public DateTime CreatedAt { get; set; }
    public bool CreatedAtIsSpecified { get; set; }
    public List<ApiRange<int>> RowNumberRanges { get; set; }
    public bool RowNumberRangesIsSpecified { get; set; }
    public bool FromAdmin { get; set; }
    public bool FromAdminIsSpecified { get; set; }
}
        
Example xml
<b:ApiCandidateGroup>
   <b:EarliestBecameRevisionDate i:nil='true'/>
   <b:EarliestBecameRevisionDateIsSpecified>false</b:EarliestBecameRevisionDateIsSpecified>
   <b:Id>12279</b:Id>
   <b:IdIsSpecified>false</b:IdIsSpecified>
   <b:IsDefault>true</b:IsDefault>
   <b:IsDefaultIsSpecified>false</b:IsDefaultIsSpecified>
   <b:Messages/>
   <b:MessagesIsSpecified>false</b:MessagesIsSpecified>
   <b:Name>Nya ansökningar för Gästföretaget, Gäst</b:Name>
   <b:NameIsSpecified>false</b:NameIsSpecified>
   <b:OwnerId>9952</b:OwnerId>
   <b:ProductGroups>
      <b:ApiCandidateGroup.ApiCandidateProductGroup>
         <b:FullIdentifier>010200</b:FullIdentifier>
         <b:FullIdentifierIsSpecified>false</b:FullIdentifierIsSpecified>
         <b:FullName>Gjutjärnsrör > Tryckrörssystem > Rör</b:FullName>
         <b:FullNameIsSpecified>false</b:FullNameIsSpecified>
         <b:Id>3</b:Id>
         <b:IdIsSpecified>false</b:IdIsSpecified>
         <b:Identifier>00</b:Identifier>
         <b:IdentifierIsSpecified>false</b:IdentifierIsSpecified>
         <b:Name>Rör</b:Name>
         <b:NameIsSpecified>false</b:NameIsSpecified>
         <b:Range>
            <b:Max>1025170</b:Max>
            <b:MaxIsSpecified>false</b:MaxIsSpecified>
            <b:Min>1024660</b:Min>
            <b:MinIsSpecified>false</b:MinIsSpecified>
         </b:Range>
         <b:RangeIsSpecified>false</b:RangeIsSpecified>
         <b:Items>
            <b:ApiCandidateGroup.ApiCandidateItem>
               <b:BecameRevisionDate i:nil='true'/>
               <b:Product>
                  ... product properties...
               </b:Product>
               <b:ProductIsSpecified>false</b:ProductIsSpecified>
               <b:RowNumber>1</b:RowNumber>
               <b:RowNumberIsSpecified>false</b:RowNumberIsSpecified>
               <b:Status>NotReviewed</b:Status>
               <b:StatusIsSpecified>false</b:StatusIsSpecified>
            </b:ApiCandidateGroup.ApiCandidateItem>
            ...
         </b:Items>
         <b:ItemsIsSpecified>false</b:ItemsIsSpecified>
      </b:ApiCandidateGroup.ApiCandidateProductGroup>
   </b:ProductGroups>
   <b:ProductGroupsIsSpecified>false</b:ProductGroupsIsSpecified>
</b:ApiCandidateGroup>

ApiCandidateImportGroupedResult describes the result from a candidate import when using ImportWithGroupedResult method.

public class ApiCandidateImportGroupedResult
{
    public List<ApiCandidateImportResult> ApiCandidateImportResults { get; set; } 
    public bool CandidatesImported { get; set; }
}
        
public class ApiCandidateImportResult
{
    public List<ApiModelValidationError> ApiModelValidationErrors { get; set; }    
    public int Index { get; set; }
    public long ProductId { get; set; }
    public string ProductIdentifier { get; set; }
}
Example xml
<b:ApiCandidateImportResults>
   <b:ApiCandidateImportResult>
      <b:ApiModelValidationErrors/>
      <b:Index>0</b:Index>
      <b:ProductId>1435535</b:ProductId>
      <b:ProductIdentifier>ART1435535</b:ProductIdentifier>
   </b:ApiCandidateImportResult>
   <b:ApiCandidateImportResult>
      <b:ApiModelValidationErrors>
         <b:ApiModelValidationError>
            <b:Field>NameSv</b:Field>
            <b:Message>...</b:Message>
         </b:ApiModelValidationError>
      </b:ApiModelValidationErrors>
      <b:Index>1</b:Index>
      <b:ProductId>1435536</b:ProductId>
      <b:ProductIdentifier>ART1435536</b:ProductIdentifier>
   </b:ApiCandidateImportResult>
</b:ApiCandidateImportResults>
<b:CandidatesImported>false</b:CandidatesImported>

An enum for Candidate change status.

public enum ApiCandidateItemStatus
{
    NotReviewed = 0,
    Revision = 50,
    RevisionOk = 100,
    QuittanceSent = 110
}
        

Candidate status flowchart

Search options used for reading candidates in method GetCandidateGroupsFiltered.

All classes that inherit from ApiCandidateSearchOptionsAbstractBase can be used as search options.

Simple identifiers

1 By status

Normal search with the option to include candidates with status "QuitttanceSent" from a specified date.

NOTE! If IncludeQuittanceSent is set to true QuittancesFromDate must be supplied with a date later than 2000-01-01.

public class ApiCandidateSearchOptions : ApiCandidateSearchOptionsAbstractBase
{
    public string ManufacturerIdentifier { get; set; }
    public bool IncludeQuittanceSent { get; set; }
    public DateTime QuittancesFromDate { get; set; }
}
    
2 By product ids

Search candidates by providing a list of product ids.

public class ApiCandidateSearchOptionsById : ApiCandidateSearchOptionsAbstractBase
{
    public string ManufacturerIdentifier { get; set; }
    public List<long< ProductIds { get; set; }
}
    
Example xml
<prod:searchOptions 
  xmlns:params='Prodibas.API.V1.Parameters' 
  xmlns:i='http://www.w3.org/2001/XMLSchema-instance' 
  i:type='params:ApiCandidateSearchOptionsById'>
   <params:ManufacturerIdentifier>MANU616</params:ManufacturerIdentifier>
   <params:ProductIds 
     xmlns:b='http://schemas.microsoft.com/2003/10/Serialization/Arrays'>
      <b:long>1435512</b:long>
      <b:long>1285831</b:long>
   </params:ProductIds>
</prod:searchOptions>